import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/group_user_entity.dart';

GroupUserEntity $GroupUserEntityFromJson(Map<String, dynamic> json) {
  final GroupUserEntity groupUserEntity = GroupUserEntity();
  final int? code = jsonConvert.convert<int>(json['Code']);
  if (code != null) {
    groupUserEntity.code = code;
  }
  final GroupUserData? data = jsonConvert.convert<GroupUserData>(json['Data']);
  if (data != null) {
    groupUserEntity.data = data;
  }
  final String? msg = jsonConvert.convert<String>(json['Msg']);
  if (msg != null) {
    groupUserEntity.msg = msg;
  }
  return groupUserEntity;
}

Map<String, dynamic> $GroupUserEntityToJson(GroupUserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Code'] = entity.code;
  data['Data'] = entity.data.toJson();
  data['Msg'] = entity.msg;
  return data;
}

extension GroupUserEntityExtension on GroupUserEntity {
  GroupUserEntity copyWith({
    int? code,
    GroupUserData? data,
    String? msg,
  }) {
    return GroupUserEntity()
      ..code = code ?? this.code
      ..data = data ?? this.data
      ..msg = msg ?? this.msg;
  }
}

GroupUserData $GroupUserDataFromJson(Map<String, dynamic> json) {
  final GroupUserData groupUserData = GroupUserData();
  final List<GroupUserDataUserList>? userList = (json['userList'] as List<
      dynamic>?)
      ?.map(
          (e) =>
      jsonConvert.convert<GroupUserDataUserList>(e) as GroupUserDataUserList)
      .toList();
  if (userList != null) {
    groupUserData.userList = userList;
  }
  final List<GroupUserDataImList>? imList = (json['imList'] as List<dynamic>?)
      ?.map(
          (e) =>
      jsonConvert.convert<GroupUserDataImList>(e) as GroupUserDataImList)
      .toList();
  if (imList != null) {
    groupUserData.imList = imList;
  }
  return groupUserData;
}

Map<String, dynamic> $GroupUserDataToJson(GroupUserData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userList'] = entity.userList.map((v) => v.toJson()).toList();
  data['imList'] = entity.imList.map((v) => v.toJson()).toList();
  return data;
}

extension GroupUserDataExtension on GroupUserData {
  GroupUserData copyWith({
    List<GroupUserDataUserList>? userList,
    List<GroupUserDataImList>? imList,
  }) {
    return GroupUserData()
      ..userList = userList ?? this.userList
      ..imList = imList ?? this.imList;
  }
}

GroupUserDataUserList $GroupUserDataUserListFromJson(
    Map<String, dynamic> json) {
  final GroupUserDataUserList groupUserDataUserList = GroupUserDataUserList();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    groupUserDataUserList.id = id;
  }
  final int? siteId = jsonConvert.convert<int>(json['site_id']);
  if (siteId != null) {
    groupUserDataUserList.siteId = siteId;
  }
  final int? groupId = jsonConvert.convert<int>(json['group_id']);
  if (groupId != null) {
    groupUserDataUserList.groupId = groupId;
  }
  final String? userName = jsonConvert.convert<String>(json['user_name']);
  if (userName != null) {
    groupUserDataUserList.userName = userName;
  }
  final String? salt = jsonConvert.convert<String>(json['salt']);
  if (salt != null) {
    groupUserDataUserList.salt = salt;
  }
  final String? password = jsonConvert.convert<String>(json['password']);
  if (password != null) {
    groupUserDataUserList.password = password;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    groupUserDataUserList.mobile = mobile;
  }
  final String? email = jsonConvert.convert<String>(json['email']);
  if (email != null) {
    groupUserDataUserList.email = email;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    groupUserDataUserList.avatar = avatar;
  }
  final String? nickName = jsonConvert.convert<String>(json['nick_name']);
  if (nickName != null) {
    groupUserDataUserList.nickName = nickName;
  }
  final String? sex = jsonConvert.convert<String>(json['sex']);
  if (sex != null) {
    groupUserDataUserList.sex = sex;
  }
  final dynamic birthday = json['birthday'];
  if (birthday != null) {
    groupUserDataUserList.birthday = birthday;
  }
  final String? telphone = jsonConvert.convert<String>(json['telphone']);
  if (telphone != null) {
    groupUserDataUserList.telphone = telphone;
  }
  final String? area = jsonConvert.convert<String>(json['area']);
  if (area != null) {
    groupUserDataUserList.area = area;
  }
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    groupUserDataUserList.address = address;
  }
  final String? qq = jsonConvert.convert<String>(json['qq']);
  if (qq != null) {
    groupUserDataUserList.qq = qq;
  }
  final String? msn = jsonConvert.convert<String>(json['msn']);
  if (msn != null) {
    groupUserDataUserList.msn = msn;
  }
  final double? amount = jsonConvert.convert<double>(json['amount']);
  if (amount != null) {
    groupUserDataUserList.amount = amount;
  }
  final int? point = jsonConvert.convert<int>(json['point']);
  if (point != null) {
    groupUserDataUserList.point = point;
  }
  final int? exp = jsonConvert.convert<int>(json['exp']);
  if (exp != null) {
    groupUserDataUserList.exp = exp;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    groupUserDataUserList.status = status;
  }
  final String? regTime = jsonConvert.convert<String>(json['reg_time']);
  if (regTime != null) {
    groupUserDataUserList.regTime = regTime;
  }
  final String? regIp = jsonConvert.convert<String>(json['reg_ip']);
  if (regIp != null) {
    groupUserDataUserList.regIp = regIp;
  }
  final String? userPhoto = jsonConvert.convert<String>(json['user_photo']);
  if (userPhoto != null) {
    groupUserDataUserList.userPhoto = userPhoto;
  }
  final String? idCard = jsonConvert.convert<String>(json['id_card']);
  if (idCard != null) {
    groupUserDataUserList.idCard = idCard;
  }
  final String? realName = jsonConvert.convert<String>(json['real_name']);
  if (realName != null) {
    groupUserDataUserList.realName = realName;
  }
  final int? isIm = jsonConvert.convert<int>(json['is_im']);
  if (isIm != null) {
    groupUserDataUserList.isIm = isIm;
  }
  final int? personalRefresh = jsonConvert.convert<int>(
      json['personal_refresh']);
  if (personalRefresh != null) {
    groupUserDataUserList.personalRefresh = personalRefresh;
  }
  final int? groupRefresh = jsonConvert.convert<int>(json['group_refresh']);
  if (groupRefresh != null) {
    groupUserDataUserList.groupRefresh = groupRefresh;
  }
  final int? oldRefresh = jsonConvert.convert<int>(json['old_refresh']);
  if (oldRefresh != null) {
    groupUserDataUserList.oldRefresh = oldRefresh;
  }
  final int? groupCode = jsonConvert.convert<int>(json['group_code']);
  if (groupCode != null) {
    groupUserDataUserList.groupCode = groupCode;
  }
  final String? invitationCode = jsonConvert.convert<String>(
      json['invitation_code']);
  if (invitationCode != null) {
    groupUserDataUserList.invitationCode = invitationCode;
  }
  final String? invitationUse = jsonConvert.convert<String>(
      json['invitation_use']);
  if (invitationUse != null) {
    groupUserDataUserList.invitationUse = invitationUse;
  }
  final int? invitationNum = jsonConvert.convert<int>(json['invitation_num']);
  if (invitationNum != null) {
    groupUserDataUserList.invitationNum = invitationNum;
  }
  final dynamic invitationTime = json['invitation_time'];
  if (invitationTime != null) {
    groupUserDataUserList.invitationTime = invitationTime;
  }
  final int? userId = jsonConvert.convert<int>(json['user_id']);
  if (userId != null) {
    groupUserDataUserList.userId = userId;
  }
  final int? registerType = jsonConvert.convert<int>(json['register_type']);
  if (registerType != null) {
    groupUserDataUserList.registerType = registerType;
  }
  return groupUserDataUserList;
}

Map<String, dynamic> $GroupUserDataUserListToJson(
    GroupUserDataUserList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['site_id'] = entity.siteId;
  data['group_id'] = entity.groupId;
  data['user_name'] = entity.userName;
  data['salt'] = entity.salt;
  data['password'] = entity.password;
  data['mobile'] = entity.mobile;
  data['email'] = entity.email;
  data['avatar'] = entity.avatar;
  data['nick_name'] = entity.nickName;
  data['sex'] = entity.sex;
  data['birthday'] = entity.birthday;
  data['telphone'] = entity.telphone;
  data['area'] = entity.area;
  data['address'] = entity.address;
  data['qq'] = entity.qq;
  data['msn'] = entity.msn;
  data['amount'] = entity.amount;
  data['point'] = entity.point;
  data['exp'] = entity.exp;
  data['status'] = entity.status;
  data['reg_time'] = entity.regTime;
  data['reg_ip'] = entity.regIp;
  data['user_photo'] = entity.userPhoto;
  data['id_card'] = entity.idCard;
  data['real_name'] = entity.realName;
  data['is_im'] = entity.isIm;
  data['personal_refresh'] = entity.personalRefresh;
  data['group_refresh'] = entity.groupRefresh;
  data['old_refresh'] = entity.oldRefresh;
  data['group_code'] = entity.groupCode;
  data['invitation_code'] = entity.invitationCode;
  data['invitation_use'] = entity.invitationUse;
  data['invitation_num'] = entity.invitationNum;
  data['invitation_time'] = entity.invitationTime;
  data['user_id'] = entity.userId;
  data['register_type'] = entity.registerType;
  return data;
}

extension GroupUserDataUserListExtension on GroupUserDataUserList {
  GroupUserDataUserList copyWith({
    int? id,
    int? siteId,
    int? groupId,
    String? userName,
    String? salt,
    String? password,
    String? mobile,
    String? email,
    String? avatar,
    String? nickName,
    String? sex,
    dynamic birthday,
    String? telphone,
    String? area,
    String? address,
    String? qq,
    String? msn,
    double? amount,
    int? point,
    int? exp,
    int? status,
    String? regTime,
    String? regIp,
    String? userPhoto,
    String? idCard,
    String? realName,
    int? isIm,
    int? personalRefresh,
    int? groupRefresh,
    int? oldRefresh,
    int? groupCode,
    String? invitationCode,
    String? invitationUse,
    int? invitationNum,
    dynamic invitationTime,
    int? userId,
    int? registerType,
  }) {
    return GroupUserDataUserList()
      ..id = id ?? this.id
      ..siteId = siteId ?? this.siteId
      ..groupId = groupId ?? this.groupId
      ..userName = userName ?? this.userName
      ..salt = salt ?? this.salt
      ..password = password ?? this.password
      ..mobile = mobile ?? this.mobile
      ..email = email ?? this.email
      ..avatar = avatar ?? this.avatar
      ..nickName = nickName ?? this.nickName
      ..sex = sex ?? this.sex
      ..birthday = birthday ?? this.birthday
      ..telphone = telphone ?? this.telphone
      ..area = area ?? this.area
      ..address = address ?? this.address
      ..qq = qq ?? this.qq
      ..msn = msn ?? this.msn
      ..amount = amount ?? this.amount
      ..point = point ?? this.point
      ..exp = exp ?? this.exp
      ..status = status ?? this.status
      ..regTime = regTime ?? this.regTime
      ..regIp = regIp ?? this.regIp
      ..userPhoto = userPhoto ?? this.userPhoto
      ..idCard = idCard ?? this.idCard
      ..realName = realName ?? this.realName
      ..isIm = isIm ?? this.isIm
      ..personalRefresh = personalRefresh ?? this.personalRefresh
      ..groupRefresh = groupRefresh ?? this.groupRefresh
      ..oldRefresh = oldRefresh ?? this.oldRefresh
      ..groupCode = groupCode ?? this.groupCode
      ..invitationCode = invitationCode ?? this.invitationCode
      ..invitationUse = invitationUse ?? this.invitationUse
      ..invitationNum = invitationNum ?? this.invitationNum
      ..invitationTime = invitationTime ?? this.invitationTime
      ..userId = userId ?? this.userId
      ..registerType = registerType ?? this.registerType;
  }
}

GroupUserDataImList $GroupUserDataImListFromJson(Map<String, dynamic> json) {
  final GroupUserDataImList groupUserDataImList = GroupUserDataImList();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    groupUserDataImList.id = id;
  }
  final String? account = jsonConvert.convert<String>(json['account']);
  if (account != null) {
    groupUserDataImList.account = account;
  }
  final String? token = jsonConvert.convert<String>(json['token']);
  if (token != null) {
    groupUserDataImList.token = token;
  }
  final String? scena = jsonConvert.convert<String>(json['scena']);
  if (scena != null) {
    groupUserDataImList.scena = scena;
  }
  final int? isUse = jsonConvert.convert<int>(json['is_use']);
  if (isUse != null) {
    groupUserDataImList.isUse = isUse;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    groupUserDataImList.nickname = nickname;
  }
  final String? plat = jsonConvert.convert<String>(json['plat']);
  if (plat != null) {
    groupUserDataImList.plat = plat;
  }
  final String? games = jsonConvert.convert<String>(json['games']);
  if (games != null) {
    groupUserDataImList.games = games;
  }
  final String? photo = jsonConvert.convert<String>(json['photo']);
  if (photo != null) {
    groupUserDataImList.photo = photo;
  }
  final String? accountUp = jsonConvert.convert<String>(json['account_up']);
  if (accountUp != null) {
    groupUserDataImList.accountUp = accountUp;
  }
  final String? accountSc = jsonConvert.convert<String>(json['account_sc']);
  if (accountSc != null) {
    groupUserDataImList.accountSc = accountSc;
  }
  final String? accountGroup = jsonConvert.convert<String>(
      json['account_group']);
  if (accountGroup != null) {
    groupUserDataImList.accountGroup = accountGroup;
  }
  final String? groupsO = jsonConvert.convert<String>(json['groups_o']);
  if (groupsO != null) {
    groupUserDataImList.groupsO = groupsO;
  }
  final String? groupsT = jsonConvert.convert<String>(json['groups_t']);
  if (groupsT != null) {
    groupUserDataImList.groupsT = groupsT;
  }
  final String? groupsTh = jsonConvert.convert<String>(json['groups_th']);
  if (groupsTh != null) {
    groupUserDataImList.groupsTh = groupsTh;
  }
  final int? isRest = jsonConvert.convert<int>(json['is_rest']);
  if (isRest != null) {
    groupUserDataImList.isRest = isRest;
  }
  final int? orderId = jsonConvert.convert<int>(json['order_id']);
  if (orderId != null) {
    groupUserDataImList.orderId = orderId;
  }
  final String? addTime = jsonConvert.convert<String>(json['add_time']);
  if (addTime != null) {
    groupUserDataImList.addTime = addTime;
  }
  final int? isHidden = jsonConvert.convert<int>(json['is_hidden']);
  if (isHidden != null) {
    groupUserDataImList.isHidden = isHidden;
  }
  final dynamic updateTime = json['update_time'];
  if (updateTime != null) {
    groupUserDataImList.updateTime = updateTime;
  }
  return groupUserDataImList;
}

Map<String, dynamic> $GroupUserDataImListToJson(GroupUserDataImList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['account'] = entity.account;
  data['token'] = entity.token;
  data['scena'] = entity.scena;
  data['is_use'] = entity.isUse;
  data['nickname'] = entity.nickname;
  data['plat'] = entity.plat;
  data['games'] = entity.games;
  data['photo'] = entity.photo;
  data['account_up'] = entity.accountUp;
  data['account_sc'] = entity.accountSc;
  data['account_group'] = entity.accountGroup;
  data['groups_o'] = entity.groupsO;
  data['groups_t'] = entity.groupsT;
  data['groups_th'] = entity.groupsTh;
  data['is_rest'] = entity.isRest;
  data['order_id'] = entity.orderId;
  data['add_time'] = entity.addTime;
  data['is_hidden'] = entity.isHidden;
  data['update_time'] = entity.updateTime;
  return data;
}

extension GroupUserDataImListExtension on GroupUserDataImList {
  GroupUserDataImList copyWith({
    int? id,
    String? account,
    String? token,
    String? scena,
    int? isUse,
    String? nickname,
    String? plat,
    String? games,
    String? photo,
    String? accountUp,
    String? accountSc,
    String? accountGroup,
    String? groupsO,
    String? groupsT,
    String? groupsTh,
    int? isRest,
    int? orderId,
    String? addTime,
    int? isHidden,
    dynamic updateTime,
  }) {
    return GroupUserDataImList()
      ..id = id ?? this.id
      ..account = account ?? this.account
      ..token = token ?? this.token
      ..scena = scena ?? this.scena
      ..isUse = isUse ?? this.isUse
      ..nickname = nickname ?? this.nickname
      ..plat = plat ?? this.plat
      ..games = games ?? this.games
      ..photo = photo ?? this.photo
      ..accountUp = accountUp ?? this.accountUp
      ..accountSc = accountSc ?? this.accountSc
      ..accountGroup = accountGroup ?? this.accountGroup
      ..groupsO = groupsO ?? this.groupsO
      ..groupsT = groupsT ?? this.groupsT
      ..groupsTh = groupsTh ?? this.groupsTh
      ..isRest = isRest ?? this.isRest
      ..orderId = orderId ?? this.orderId
      ..addTime = addTime ?? this.addTime
      ..isHidden = isHidden ?? this.isHidden
      ..updateTime = updateTime ?? this.updateTime;
  }
}